package com.wangle.base.agent.cglib.code;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class MyServiceInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object target, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
        System.out.println("前置通知");
        Object invoke = methodProxy.invokeSuper(target, args);
        System.out.println("后置通知");
        return invoke;
    }
}
